<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Reset all options of a libcurl session handle</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.curl-pause.html">curl_pause</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.curl-setopt-array.html">curl_setopt_array</a></div>
 <div class="up"><a href="ref.curl.html">cURL 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.curl-reset" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">curl_reset</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.5.0)</p><p class="refpurpose"><span class="refname">curl_reset</span> &mdash; <span class="dc-title">Reset all options of a libcurl session handle</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.curl-reset-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type"><span class="type void">void</span></span> <span class="methodname"><strong>curl_reset</strong></span>
    ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$ch</code></span>
   )</div>

  <p class="para rdfs-comment">
   This function re-initializes all options set on the given cURL handle to the default values.
  </p>

 </div>


 <div class="refsect1 parameters" id="refsect1-function.curl-reset-parameters">
  <h3 class="title">参数</h3>
  <dl>

   <dt>
<em><code class="parameter">ch</code></em>
</dt>
<dd>
<p class="para">由 <span class="function"><a href="function.curl-init.html" class="function">curl_init()</a></span> 返回的 cURL 句柄。</p></dd>

  </dl>

 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.curl-reset-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   没有返回值。
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.curl-reset-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-4132">
    <p><strong>Example #1 <span class="function"><strong>curl_reset()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">//&nbsp;Create&nbsp;a&nbsp;curl&nbsp;handle<br /></span><span style="color: #0000BB">$ch&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">curl_init</span><span style="color: #007700">();<br /><br /></span><span style="color: #FF8000">//&nbsp;Set&nbsp;CURLOPT_USERAGENT&nbsp;option<br /></span><span style="color: #0000BB">curl_setopt</span><span style="color: #007700">(</span><span style="color: #0000BB">$ch</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">CURLOPT_USERAGENT</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"My&nbsp;test&nbsp;user-agent"</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;Reset&nbsp;all&nbsp;previously&nbsp;set&nbsp;options<br /></span><span style="color: #0000BB">curl_reset</span><span style="color: #007700">(</span><span style="color: #0000BB">$ch</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;Send&nbsp;HTTP&nbsp;request<br /></span><span style="color: #0000BB">curl_setopt</span><span style="color: #007700">(</span><span style="color: #0000BB">$ch</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">CURLOPT_URL</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'http://example.com/'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">curl_exec</span><span style="color: #007700">(</span><span style="color: #0000BB">$ch</span><span style="color: #007700">);&nbsp;</span><span style="color: #FF8000">//&nbsp;the&nbsp;previously&nbsp;set&nbsp;user-agent&nbsp;will&nbsp;be&nbsp;not&nbsp;sent,&nbsp;it&nbsp;has&nbsp;been&nbsp;reset&nbsp;by&nbsp;curl_reset<br /><br />//&nbsp;Close&nbsp;the&nbsp;handle<br /></span><span style="color: #0000BB">curl_close</span><span style="color: #007700">(</span><span style="color: #0000BB">$ch</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.curl-reset-notes">
  <h3 class="title">注释</h3>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    <span class="function"><strong>curl_reset()</strong></span> also resets the URL given as the <span class="function"><a href="function.curl-init.html" class="function">curl_init()</a></span> parameter.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.curl-reset-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.curl-setopt.html" class="function" rel="rdfs-seeAlso">curl_setopt()</a> - 设置一个cURL传输选项</span></li>
   </ul>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.curl-pause.html">curl_pause</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.curl-setopt-array.html">curl_setopt_array</a></div>
 <div class="up"><a href="ref.curl.html">cURL 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
